﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" rev="stylesheet" href="../css/style.css"
	type="text/css" media="all" />
<script language="JavaScript" type="text/javascript">
	function check() {
		document.getElementById("aa").style.display = "";
	}
	
	function save(){
		if(document.form.devname.value == null || document.form.devname.value == ""){
			alert("设备名称必须填写");
			document.form.devname.focus();
			return;
		}
		else if(document.form.devserial.value == null || document.form.devserial.value == "必须是数字"){
			alert("设备编号必须填写且是数字");
			document.form.devserial.focus();
			return;
		}
		else if(document.form.devmdate.value == null || document.form.devmdate.value == ""){
			alert("制造日期必须填写");
			document.form.devmdate.focus();
			return;
		}
		else if(document.form.devedate.value == null || document.form.devedate.value == ""){
			alert("截止日期必须填写");
			document.form.devedate.focus();
			return;
		}
		else if(confirm("确认保存？")){
			document.form.submit();			
		}
	}
	
</script>
<style type="text/css">
<!--
.atten {
	font-size: 12px;
	font-weight: normal;
	color: #F00;
}
-->
</style>
</head>

<body class="ContentBody">
	<form action="AddNewDevice" method="post" name="form" target="_self">
		<div class="MainDiv">
			<table width="99%" border="0" cellpadding="0" cellspacing="0"
				class="CContent">
				<tr>
					<th class="tablestyle_title">设备添加</th>
				</tr>
				<tr>
					<td class="CPanel">
						<table border="0" cellpadding="0" cellspacing="0"
							style="width: 100%">
							<tr>
								<td align="left"><input type="button" name="Submit"
									value="保存" class="button" onclick="save()" /> <input type="button"
									name="Submit2" value="返回" class="button"
									onclick="window.history.go(-1);" /></td>
							</tr>
							<tr>
								<td width="100%">
									<fieldset style="height: 100%;">
										<legend>设备信息</legend>
										<table border="0" cellpadding="2" cellspacing="1"
											style="width: 100%">
											<tr>
												<td nowrap align="right" width="15%">设备名称:</td>
												<td width="35%"><input name='devname' type="text"
													class="text" style="width: 154px" value="" /> <span
													class="red"></span></td>
												<td width="16%" align="right" nowrap="nowrap">设备编号:</td>
												<td width="34%"><input class="text" type="text" name='devserial'
													style="width: 154px" value="必须是数字" onFocus="if (value =='必须是数字'){value =''}" /><span
													class="red"></span></td>
											</tr>
											<tr>
												<td nowrap="nowrap" align="right">规格型号:</td>
												<td><input  class="text" name='devmodel'
													style="width: 154px" value="" /></td>
												<td align="right">制造日期:</td>
												<td><input type="date" class="text" name='devmdate'
													style="width: 154px" value="" /><span
													class="red"></span></td>
											</tr>

											<tr>
												<td nowrap="nowrap" align="right">截止日期:</td>
												<td><input type="date" class="text" name='devedate'
													style="width: 154px" value="" /><span
													class="red"><span></td>
												<td align="right">使用部门:</td>
												<td><input class="text" name='devdepart'
													style="width: 154px" value="" /></td>
											</tr>
											<tr>
												<td nowrap="nowrap" align="right">生产厂家:</td>
												<td><input class="text" name='devcomp'
													style="width: 154px" value="" /></td>
												<td nowrap="nowrap" align="right">使用人:</td>
												<td><input class="text" name='devuser'
													style="width: 154px" value="" /></td>
											</tr>
											<tr>
												<td align="right">备注:</td>
												<td colspan="3"><textarea id="remarks" name="remarks"
														cols="100" rows="8"></textarea></td>
											</tr>
										</table>
										<br />
									</fieldset>
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center" height="50px"><input
						type="button" name="Submit" value="保存" class="button" onclick="save()" />

						<input type="button" name="Submit2" value="返回" class="button"
						onclick="window.history.go(-1);" /></td>
				</tr>
			</table>
		</div>
	</form>
</body>
</html>
